package com.juku2024.juku.dialog

import android.app.Dialog
import android.content.Context
import android.os.Bundle
import com.juku2024.juku.R

class CommonLoadingDialog(context: Context, style: Int = R.style.CommonDialogStyle) : Dialog(context, style) {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.dialog_common_loading)
        setCanceledOnTouchOutside(false) //点击边际可消失
    }

    companion object{
        fun showLoadingDialog(context: Context): CommonLoadingDialog {
            val loadingDialog = CommonLoadingDialog(context)
            loadingDialog.show()
            return loadingDialog
        }
    }

}